import { Body, Controller, Post } from '@nestjs/common'
import { TaskService } from './task.service'

@Controller('task')
export class TaskController {
  constructor(private readonly taskService: TaskService) { }

  @Post('del')
  del(@Body() body) {
    return this.taskService.del(body.id as number)
  }

  @Post('approve')
  edit(@Body() body) {
    return this.taskService.update(body)
  }

  @Post('page')
  page(@Body() body) {
    return this.taskService.getPageList(body)
  }

  @Post('detail')
  getDetail(@Body() body) {
    return this.taskService.getDetail({ type: body.type, code: body.code })
  }

  // 获取可领用资产列表
  @Post('getReceiveAssetList')
  getReceiveAssetList(@Body() body) {
    return this.taskService.getReceiveAssetList(body)
  }
}
